using System;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Collections;


namespace ManticLabs.Data
{


    /// <summary>
    /// Summary description for DataAccess.
    /// </summary>
    /// 

    public interface IDataAccess
    {



        ArrayList getFieldAttributes();

        void ExecuteSQLNonQuery(string SQLStr);

        object GetDBDataAsScalar(string SQLStr);

        DAArrayList GetRowsAsArrayList(ResultType resType, string spCall, DbParameter[] paramList, bool setFieldAttributes);

        DAArrayList GetRowsAsArrayList(ResultType resType, string SQLStr, bool setFieldAttributes);

        DAArrayList GetRowsAsArrayList(ResultType resType, string spName, object[] paramsList, bool setFieldAttributes);

        IDataReader GetRowsAsSQLDataReader(ResultType resType, string spCall, DbParameter[] paramList);

        IDataReader GetRowsAsSQLDataReader(ResultType resType, string SQLStr);

        IDataReader GetRowsAsSQLDataReader(ResultType resType, string spName, object[] paramsList);

        IDataReader GetRowsAsSQLDataReader(string spCall, DbParameter[] paramList);

        bool Update(string spCall, DbParameter[] paramList);

        int Update(string SQLStr);

        bool Update(string spName, object[] paramsList);

        void BeginTrans();

        void RollbackTrans();

        void CommitTrans();

        void CloseDataReader();

        DataSet GetRowsAsDataSet(string spCall, DbParameter[] paramList);

        DataSet GetRowsAsDataSet(string SQLStr);

        void GetRowsAsDataSet(string SQLStr, ref DataSet prmDs);


        /// <summary>
        /// This function take care of multiple result sets and return all in on row. Although it seems it is not
        /// useful but in case of multiple result sets are returned due to the nature of
        /// stored procedures used in those. Only the last result sets is to be checked as it has ERROR_CODE field.
        /// It is not posible to have other command behaviors than Default so that is omitted.
        /// It is also no possible to build field attribute info as different result sets can have different Schemas
        /// </summary>
        /// <param name="spCall"> Name of the Stored procedure. Anything else wil through an exception</param>
        /// <param name="paramList">Parameter List of the procedure</param>
        /// <returns></returns>
        DAArrayList GetBatchAsArrayList(string spCall, DbParameter[] paramList);

        /// <summary>
        /// Used in 7.3
        /// </summary>
        /// <param name="resType"></param>
        /// <param name="spCall"></param>
        /// <param name="paramList"></param>
        /// <param name="setFieldAttributes"></param>
        /// <param name="paramname"></param>
        /// <returns></returns>
        string getoutPutparam(ResultType resType, string spCall, DbParameter[] paramList, bool setFieldAttributes, string paramname);


    }


}
